#pragma once

#include "Channel.h"
#include "MessageHeader.h"
#include "BitStream.h"

namespace phynet{
namespace net{

bool Channel::MessageSend(MessageHeader& io_header, const BitStream* i_message)
{
	io_header.sequence = m_seqNumber;
	++m_seqNumber;

	BitStream* message = new BitStream;
	message->WriteType(io_header);
	if(i_message)
		message->AppendBitStream(*i_message);

	m_outQueue.push_back(message);

	return true;
}

}} //namespaces